<?php
class PostController extends Controller{



    function IndexAction(){
        $this->render('index',array('name'=>'mengzhi','age'=>24));
    }

    function NewAction(){
        $this->render('new');
    }

    function CreateAction(){
        $post['title'] = $_POST['title'];
        $post['content'] = $_POST['content'];
        $post['uid'] = 1;
        $post['created'] = $post['updated'] = time();
        $M_post = new Post();
        if($M_post->addPost($post)){
            $this->redirect(array('site/index'));
        }
        echo 'Error!';
    }


}